package com.dd.ent.car.ui.user;

import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.dd.ent.car.R;


/**
 * Author   LT
 * Time   2016/5/17 18:57
 */
public class UserAccountItem extends LinearLayout {

    private TextView mAccountItemName;
    private TextView mAccountItemTipText;
    private ImageView mAccountItemTipPic;
    private ImageView mAccountItemTipIcon;

    public UserAccountItem(Context context) {
        super(context);
        initView(context);
    }

    public UserAccountItem(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    public UserAccountItem(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
    }

    public void initView(Context context) {
        LayoutInflater.from(context).inflate(R.layout.user_account_item, this);
        mAccountItemName = (TextView) findViewById(R.id.tv_account_item_name);
        mAccountItemTipText = (TextView) findViewById(R.id.tv_account_item_tip_text);
        mAccountItemTipPic = (ImageView) findViewById(R.id.iv_account_item_tip_pic);
        mAccountItemTipIcon = (ImageView) findViewById(R.id.tv_account_item_tip_icon);
    }

    public void setAccountItemName(int itemName) {
        mAccountItemName.setText(itemName);
    }

    public void setAccountItemName(String itemName) {
        mAccountItemName.setText(itemName);
    }

    public void setItemTipPicVisibility(int visibility) {
        mAccountItemTipPic.setVisibility(visibility);
    }

    public ImageView getAccountItemTipPic() {
        return mAccountItemTipPic;
    }

    public void setItemTipIconVisibility(int visibility) {
        mAccountItemTipIcon.setVisibility(visibility);
    }

    public void setItemTipTextVisibility(int visibility) {
        mAccountItemTipText.setVisibility(visibility);
    }

    public void setItemTipPic(int resId) {
        mAccountItemTipPic.setBackgroundResource(resId);
    }

    public void setItemTipText(int resId) {
        mAccountItemTipText.setText(resId);
    }

    public void setItemTipText(String str) {
        mAccountItemTipText.setText(str);
    }

    public void setItemTipTextColor(int color) {
        mAccountItemTipText.setTextColor(color);
    }

    public void setImageBitmap(Bitmap bitmap) {
        mAccountItemTipPic.setImageBitmap(bitmap);
    }
}
